<template>
  <div class="subDetail">
    <jxf-titletip :title="title" :hasRefresh="false" :hasGoBack="true" @goBack="$emit('goBack')"></jxf-titletip>
    <div class="jxf-content mt20">
      <el-card class="jxf-table-card mt10">
        <div slot="header" class="clearfix">
          <span>查看员工</span>
        </div>
        <div class="listArea">
          <jxf-datalist :info="dataInfo.detailInfo" :lineNum="2">
            <template slot="password" slot-scope="detailInfo">
              <div>
                {{detailInfo.info.value}}
                &nbsp;
                <el-button type="text">重置密码</el-button>
              </div>
            </template>
            <template slot="purchasingAuthority" slot-scope="detailInfo">
              <div>
                <el-checkbox v-model="detailInfo.info.value == '0' ? false : true" disabled>采购权限</el-checkbox>
              </div>
            </template>
            <template slot="financialAuthority" slot-scope="detailInfo">
              <div>
                <el-checkbox v-model="detailInfo.info.value == '0' ? false : true" disabled>财务权限</el-checkbox>
              </div>
            </template>
            <template slot="receipt" slot-scope="detailInfo">
              <div>
                <el-checkbox v-model="detailInfo.info.value == '0' ? false : true" disabled>收货员权限</el-checkbox>
              </div>
            </template>
          </jxf-datalist>
          <div class="btn-group">
            <el-button type="primary" @click="goPreview">返回</el-button>
          </div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
    export default {
        name: "SubDetail",
        props: {
          dataInfo: {
            type: Object,
            default: () => {}
          }
        },
        data() {
          return {
            title: "查看"
          }
        },
        methods: {
          goPreview() {
            this.$emit('goBack')
          }
        }
    }
</script>

<style lang="scss" scoped>
.subDetail {
  .btn-group {
    display: flex;
    padding: 10px;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
}
</style>
